import 'package:flutter/material.dart';

class FormListVC extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('登录注册'),
      ),
      body: Container(
        child: FormListContent(),
      ),
    );
  }
}

class FormListContent extends StatefulWidget {
  const FormListContent({Key? key}) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    return _FormListState();
  }
}

class _FormListState extends State<FormListContent> {
  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        TextField(
          decoration: InputDecoration(
              border: InputBorder.none,
              icon: Icon(Icons.people),
              labelText: 'username',
              hintText: "请输入用户名",
              fillColor: Colors.lightGreen,
              filled: true),
          onChanged: (value) {
            print("输入用户名:${value}");
          },
          onSubmitted: (value) {
            print("提交用户名:${value}");
          },
        ),
        TextField(
          decoration: InputDecoration(
              border: InputBorder.none,
              icon: Icon(Icons.password),
              labelText: "password",
              hintText: "请输入密码",
              fillColor: Colors.red,
              filled: true),
          onChanged: (value) {
            print("输入用户名:${value}");
          },
          onSubmitted: (value) {
            print("提交用户名:${value}");
          },
        )
      ],
    );
  }
}
